import unittest
import sys
import os

sys.path += [os.path.abspath('..')]

from utils.image_thumbnailer import ImageThumbnailer, ImageThumbnailerException

class ImageThumbnailerTest(unittest.TestCase):

    def setUp(self):
        self.debug = False
        self.filename = os.path.abspath('.') + '/data/ImageThumbnailer/test.jpg'

    def testThumbnailer(self):
        thumbnailer = ImageThumbnailer(self.filename)
        thumbnailer.create_thumbnail()
        if self.debug:
            print 'Expecting thumbnail : %s' % thumbnailer._thumb_file
        self.assertTrue(os.path.exists(thumbnailer._thumb_file))
